package com.zmn.oms.services.interfaces.masterworking;

import com.zmn.oms.model.entity.masterworking.MasterWorking;
import com.zmn.oms.model.entity.masterworking.MasterWorkingQuery;

import java.util.List;

/**
 * 类描述：工程师进行中工单
 *
 * @author lujia
 * @date 2018/11/03 16:45
 */
public interface MasterWorkingService {

    /**
     * 根据工程师ID 和预约时间范围查询
     *
     * @param masterWorkingQuery
     * @return
     */
    List<MasterWorking> listMasterWorkingByQuery(MasterWorkingQuery masterWorkingQuery);

    /**
     * 根据工程师id查询进行中工单集合
     *
     * @param masterId 工程师id
     * @return 工单集合
     */
    List<MasterWorking> listMasterWorkingByMasterId(Integer masterId);

    /**
     * 跟单工单ID查询
     * @param workIdList
     * @return
     */
    List<MasterWorking> listMasterWorkingByWorkIdList(List<Long> workIdList);

    /**
     * 根据工单ID查询
     *
     * @param workId
     * @return
     */
    MasterWorking findMasterWorkingByWorkId(Long workId);

    /**
     * 修改状态
     *
     * @param workId
     * @param status
     */
    void updateMasterWorkingStatus(Long workId, Integer status);

    /**
     * 修改师傅进行中工单状态
     *
     * @param workId
     * @param delivery
     * @param waitPart
     */
    void updateMasterWorkingStatus(Long workId, Integer delivery, Integer waitPart, Integer waitCancel);

    /**
     * 修改进行中工单
     *
     * @param masterWorking
     * @return 影响行数
     */
    int updateMasterWorking(MasterWorking masterWorking);

    /**
     * 修改进行中预约时间
     *
     * @param masterWorking
     */
    void updateWorkingDutyTimeByKey(MasterWorking masterWorking);

    /**
     * 修改进行中工单渠道
     *
     * @param channelId
     * @param channelName
     * @return 影响行数
     */
    void updateMasterWorkingChannel(Long workId, Integer channelId, String channelName, Integer servItemType);

    /**
     * 保存，不存在新增，已存在修改
     *
     * @param masterWorking
     * @return 影响行数
     */
    void saveMasterWorking(MasterWorking masterWorking);

    /**
     * 删除进行中工单
     *
     * @param workId
     * @return 影响行数
     */
    boolean deleteMasterWorking(Long workId);

    int updateWorkingWaitSchedulingByKey(MasterWorking masterWorking);

    /**
     * 修改改派状态
     * @param masterWorking
     * @return 数量
     */
    int updateRedistributeStatusByKey(MasterWorking masterWorking);
}
